package com.example.onlineeducation.data.constant

import android.os.Environment
import com.example.onlineeducation.App
import com.example.onlineeducation.R
import com.yc.jetpacklib.utils.YcRandom
import com.yc.jetpacklib.utils.YcResources
import com.yc.jetpacklib.utils.YcVersionUtil
import java.io.File

object Constants {

    /**
     * apk保存路径
     */
    @JvmStatic
    fun apkPath() = APK_SAVE_FILES_DIR + File.separator + "apk" + File.separator +
            YcResources.getString(R.string.app_name) + "_" + YcVersionUtil.versionName + YcRandom.getString(2) + ".apk"


    /**
     * 相册图片路径
     */
    @JvmStatic
    fun imgPath(pictureName: String) = App.mInstant.getExternalFilesDir(Environment.DIRECTORY_PICTURES)?.absolutePath + File.separator + pictureName


    /**
     * apk保存路径
     */
    @JvmStatic
    fun filePath(fileName: String) = Environment.getExternalStorageDirectory().path + File.separator + fileName

    private val APK_SAVE_FILES_DIR by lazy {
        App.mInstant.filesDir.path + File.separator
    }


}